package cn.wolfcode.p2p.bussness.service;

import cn.wolfcode.p2p.base.query.QueryObjext;
import cn.wolfcode.p2p.bussness.domain.BidRequest;
import cn.wolfcode.p2p.bussness.query.BidRequestQueryObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

public interface IBidRequestService {
    int save(BidRequest record);

    BidRequest get(Long id);

    PageInfo queryPage(BidRequestQueryObject qo);

    int update(BidRequest record);

    /**
     * 借款申请
     * @param bidRequest
     */
    void apply(BidRequest bidRequest);

    void publishAudit(Long id, Date publishTime, Integer state, String remark);

    List<BidRequest> queryPublishPendngBidRrequests();

    List<BidRequest> queryPendingBidRequest();

    /**
     * 查询首页的数据
     * @return
     */
    List<BidRequest> queryIndexData();

    /**
     * 用户投标
     * @param bidRequestId
     * @param amount
     */
    void bid(Long bidRequestId, BigDecimal amount);

    /**
     * 满标一审
     * @param id
     * @param state
     * @param remark
     */
    void audit(Long id, Integer state, String remark);

    /**
     * 满标二审
     * @param id
     * @param state
     * @param remark
     */
    void audit2(Long id, Integer state, String remark);
}
